package com.lienlq.voicemusic.ui;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

class MusicAdapter extends FragmentPagerAdapter {
	private static final String[] CONTENT = new String[] { "Bài hát", "Nhạc sĩ", "Ca sĩ", "Thể loại", "Tìm kiếm"};
	public MusicAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		// TODO Auto-generated method stub
		//super.destroyItem(container, position, object);
	}

	@Override
	public Fragment getItem(int position) {
		switch (position) {
		case 0:
			return new TrackFragment();
		case 1:
			return new ComposerFragment();
		case 2:
			return new ArtistFragment();
		case 3:
			return new GenreFragment();

		default:

			return TestFragment.newInstance(CONTENT[position
					% CONTENT.length]);
		}
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return CONTENT[position % CONTENT.length];
	}

	@Override
	public int getCount() {
		return CONTENT.length;
	}
}